package com.tang.security.datasource;

import lombok.RequiredArgsConstructor;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.jdbc.core.JdbcTemplate;

/**
 * @author: TangLiang
 * @date: 2021/5/11 11:32
 * @since: 1.0
 */
@SpringBootTest
public class datasource {
    @Autowired
    private JdbcTemplate readJdbcTemplate;
    @Autowired
    private JdbcTemplate writeJdbcTemplate;

    @Test
    public void read() {
        readJdbcTemplate.queryForList("select * from tx_realtime_parm_test");
    }

    @Test
    public void write() {
        writeJdbcTemplate.update("insert into tx_realtime_parm_test (name_, code_) values (?, ?)", "测试读", "testWrite");
    }
}
